package com.rxb.blog.mapper;

import com.rxb.blog.entity.ArticleInfoEntity;
import com.rxb.blog.vo.ArticleInfoVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Author：rxb
 * Date：2020-02-26 16:41
 * Description：<描述>
 */
@Repository
public interface ArticleInfoMapper {
    /**
     * 写博客，返回主键id
     * @param articleInfoEntity
     * @return
     */
    int insertArticleInfo(@Param("article") ArticleInfoEntity articleInfoEntity);

    List<ArticleInfoEntity> getMyArticleList(@Param("article") ArticleInfoVo articleInfoVo);

    int getTotalMyArticles(@Param("article") ArticleInfoVo articleInfoVo);

    ArticleInfoVo getArticleDetail(@Param("id") Integer id);

    void updateArticleInfo(@Param("article") ArticleInfoEntity articleInfoEntity);

    void deleteArticle(@Param("id") Integer id);

    void updataToTop(@Param("id") Integer id);

    void updataCancleTop(@Param("id") Integer id);

    List<Map> getArticleListWithType(@Param("articleTypeName") String articleTypeName);
}
